#ifndef GRAPHALGORITHM_H
#define GRAPHALGORITHM_H

#include <QImage>
#include "graphicinfo.h"
#include "Bezier.h"
#include "BSpline.h"

void DDA(QImage *image, const QPoint &p1, const QPoint &p2, QRgb value);
void DDA(QImage *image, const QPointF &p1, const QPointF &p2, QRgb value);
void Polygon6(QImage *, int, int, int, GraphicInfo&, QRgb value);
void Polygon3(QImage *, const QPoint&, const QPoint&, const QPoint&, QRgb value);
void task2(QImage *, int, int, int u = 10);
void bshLine(QImage *image, const QPoint &p1, const QPoint &p2, QRgb value);
void bshEllipse(QImage *, const QPoint &, const QSize &, QRgb);
void drawPart(QImage *image, const QPoint &center, const QSize &size, QRgb value, int part);

void DrawBezier(QPainter &, const GraphicInfo&);
void DrawBsp(QPainter &, const GraphicInfo&);

void DrawBezier(QImage *, const QVector<QPointF>&, QRgb);
void DrawBsp(QImage *, const QVector<QPointF>&, QRgb, int = 1);

void trans(QImage *image, int Tx, int Ty, int Graph, GraphicInfo&);
void scale(QImage *image, double Sx, double Sy, int Graph, GraphicInfo&);
void rotate(QImage *image, double R, const QPoint &pR, int Graph, GraphicInfo &);

void scanLineFill(QImage *image, const QPoint* points, QRgb value, int);
void CohenSutherlandClip(QImage *image, const QRect &rect, int x1, int y1, int x2, int y2, QRgb value);

struct edge
{
    int INS_x;
    int max_y;
    double dk;

};

#endif // GRAPHALGORITHM_H
